package com.ljy.tkmodel.controller;


import com.ljy.tkmodel.entity.Course;
import com.ljy.tkmodel.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/course")
public class CourseController {
    @Autowired
    CourseService courseService;

    @PostMapping("saveCourse")
    public int saveCourse(Course course){
        return courseService.insertCourse(course);
    }

    @GetMapping("queryConditionCourse")
    public List<Course> queryConditionCourse(Map map){
        return courseService.selectCourse(map);
    }

}

